<template>
  <view :style="themeColor">
    <view class="page">
      <view
        class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex logOutRisk_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-stretch justify-between logOutRisk_fd0_0'>
          <view class='flex flex-wrap align-center logOutRisk_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  logOutRisk_fd0_0_c0_c0'>&#xe794;</text>
          </view>
          <view class='flex flex-wrap align-center'>
            <text class='logOutRisk_fd0_0_c1_c0'>{{$t('注销账号')}}</text>
          </view>
          <view class='flex align-center justify-end logOutRisk_fd0_0_c2'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---注销账号风险-提示flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch logOutRisk_flex_1">
        <view class='flex flex-wrap align-center logOutRisk_fd1_0'>
          <image class='logOutRisk_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"228.png"'></image>
          <text class='logOutRisk_fd1_0_c1'>{{$t('账号注销')}}</text>
        </view>
        <text class='logOutRisk_fd1_1'>{{$t('永久注销且无法恢复，请谨慎操作')}}</text>
        <text class='logOutRisk_fd1_2'>{{$t('账号注销后将放弃以下权益：')}}</text>
        <jyf-parser class='logOutRisk_fd1_3' :html="dataMessage.content | richTextFormat">
        </jyf-parser>
        <text class='logOutRisk_fd1_4'>{{$t('点击下方按钮，即表示你已阅读并了解以上风险')}}</text>
        <view class='flex flex-direction align-center logOutRisk_fd1_5'>
          <button class='logOutRisk_fd1_5_c0' @tap.stop="popupShow1657003349241=true">{{$t('我已清楚风险，确定继续')}}</button>
          <button class='logOutRisk_fd1_5_c1' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">{{$t('返回')}}</button>
        </view>
      </view>

      <!---注销账号风险-提示flex布局结束-->
      <benben-popup v-model="popupShow1657003349241" :mask="true" :mask-close-able="true" mode='center'>
        <!---注销弹窗确认flex布局开始-->
        <view class="flex flex-direction flex-wrap align-center logOutRisk_flex_2">
          <text class='logOutRisk_fd2_0'>{{$t('提示')}}</text>
          <text class='logOutRisk_fd2_1'>{{$t('请再次确认，你已了解注销风险， 并要继续执行该操作')}}</text>
          <view class='flex align-center logOutRisk_fd2_2'>
            <button class='logOutRisk_fd2_2_c0' @tap.stop="popupShow1657003349241=false">{{$t('取消')}}</button>
            <button class='logOutRisk_fd2_2_c1' @tap.stop="submitzxFunc()">{{$t('确定')}}</button>
          </view>
        </view>

        <!---注销弹窗确认flex布局结束-->

      </benben-popup>


    </view>
  </view>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        "popupShow1657003349241": false,
        "dataMessage": {
          "aid": "",
          "name": "",
          "thumb_img": "",
          "content": "",
          "introduce": ""
        },
        "cancel_type": "1",
        "cancel_reason": "不想使用了"
      };
    },
    computed: {
      themeColor() {
        return this.$store.getters.themeColor
      },

    },
    watch: {},
    onLoad(options) {
      let {
        cancel_type,
        cancel_reason
      } = options
      if (cancel_type !== undefined) this.cancel_type = cancel_type
      if (cancel_reason !== undefined) this.cancel_reason = cancel_reason
      this.getMessageFunc()
    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //系统文章--获取系统单页内容
      async getMessageFunc() {
        //请求方法
        //数据验证

        let datadataMessage = await this.$api.get(global.apiUrls.getOtherPactInfo, {
          pacType: 'cancelGive'

        });

        if (datadataMessage.data.code != 0) {
          this.$message.info(datadataMessage.data.msg);
          return
        }
        let infodataMessage = datadataMessage.data;
        this.dataMessage = infodataMessage.data

      },
      //发送注销
      async submitzxFunc() {
        //请求方法
        //数据验证

        let data637c4d70d3aa8 = await this.$api.post(global.apiUrls.addLogoutRec, {
          logoutSelect: this.cancel_type,
          logoutReason: this.cancel_reason
        });

        if (data637c4d70d3aa8.data.code != 0) {
          this.$message.info(data637c4d70d3aa8.data.msg);
          return
        }



        this.popupShow1657003349241 = false;
        uni.showToast({
          title: global.i18n.t('注销成功'),
          mask: true,
          icon: 'none',
          duration: 1500
        });
        setTimeout(() => {
          this.$store.commit('logout')
          this.$urouter.reLaunch(`/pages/tabBar/myhb/myhb`);
        }, 1500)
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #fff;
    background-size: 100% auto;
  }

  .logOutRisk_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .logOutRisk_fd0_0_c2 {
    padding: 0rpx 0rpx 0rpx 0rpx;
    width: 100rpx;
  }

  .logOutRisk_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 500;
    color: #333333;
    line-height: 50rpx;
  }

  .logOutRisk_fd0_0_c0_c0 {
    font-size: 36rpx;
    font-weight: 400;
    color: #333;
  }

  .logOutRisk_fd0_0_c0 {
    width: 100rpx;
  }

  .logOutRisk_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
    line-height: 88rpx;
  }

  .logOutRisk_flex_1 {
    background: #fff;
    font-size: 32rpx;
    background-size: 100% auto !important;
    padding: 32rpx 32rpx 32rpx 32rpx;
    margin: 0rpx 0rpx 200rpx 0rpx;
  }

  .logOutRisk_fd1_5_c1 {
    border: 1px solid var(--benbenbdColor0);
    background: var(--benbenbgColor1);
    border-radius: 50rpx 50rpx 50rpx 50rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor0);
    width: 686rpx;
    height: 88rpx;
    line-height: 88rpx;
    font-weight: 400;
    margin: 32rpx 0rpx 0rpx 0rpx;
  }

  .logOutRisk_fd1_5_c0 {
    background: var(--benbenbgColor7);
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    font-size: 32rpx;
    color: var(--benbenFontColor3);
    width: 686rpx;
    height: 88rpx;
    line-height: 88rpx;
    font-weight: 400;
    padding: 0rpx 0rpx 0rpx 0rpx;
  }

  .logOutRisk_fd1_5 {
    position: fixed;
    left: 32rpx;
    bottom: calc(40rpx + var(--window-bottom));
  }

  .logOutRisk_fd1_4 {
    border-top: 1px solid #eee;
    background: #fff;
    font-size: 24rpx;
    font-weight: 400;
    color: var(--benbenFontColor4);
    margin: 32rpx 0rpx 0rpx 0rpx;
    padding: 32rpx 0rpx 0rpx 0rpx;
  }

  ::v-deep .logOutRisk_fd1_3 {
    width: 100%;
  }

  .logOutRisk_fd1_2 {
    line-height: 45rpx;
    font-size: 32rpx;
    font-weight: 700;
    color: var(--benbenFontColor0);
    padding: 56rpx 0rpx 24rpx 0rpx;
  }

  .logOutRisk_fd1_1 {
    line-height: 40rpx;
    font-size: 28rpx;
    font-weight: 500;
    color: var(--benbenFontColor0);
  }

  .logOutRisk_fd1_0_c1 {
    line-height: 45rpx;
    font-size: 32rpx;
    font-weight: 700;
    color: var(--benbenFontColor0);
  }

  .logOutRisk_fd1_0_c0 {
    width: 36rpx;
    height: 36rpx;
    border-radius: 0rpx 0rpx 0rpx 0rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .logOutRisk_fd1_0 {
    margin: 0rpx 0rpx 24rpx 0rpx;
  }

  .logOutRisk_flex_2 {
    background: #fff;
    width: 540rpx;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
  }

  .logOutRisk_fd2_2_c1 {
    border-top: 1px solid #eee;
    border-left: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 16rpx 0rpx;
    font-size: 32rpx;
    color: var(--benbenbgColor7);
    width: 269rpx;
  }

  .logOutRisk_fd2_2_c0 {
    border-top: 1px solid #eee;
    background: #fff;
    line-height: 110rpx;
    border-radius: 0rpx 0rpx 0rpx 16rpx;
    font-size: 32rpx;
    color: rgba(153, 153, 153, 1);
    width: 269rpx;
  }

  .logOutRisk_fd2_2 {
    margin: 33rpx 0rpx 0rpx 0rpx;
  }

  .logOutRisk_fd2_1 {
    line-height: 52rpx;
    font-size: 28rpx;
    font-weight: 400;
    color: #333333;
    text-align: center;
    margin: 32rpx 60rpx 0rpx 60rpx;
  }

  .logOutRisk_fd2_0 {
    margin: 32rpx 0rpx 0rpx 0rpx;
    font-size: 32rpx;
    font-weight: 600;
    color: #333;
  }
</style>
